package com.ugoodtech.mdcc.client.service.impl;

import com.mysema.query.BooleanBuilder;
import com.ugoodtech.mdcc.client.service.CustomerReportService;
import com.ugoodtech.mdcc.core.domain.CustomerRegularReport;
import com.ugoodtech.mdcc.core.domain.QCustomerRegularReport;
import com.ugoodtech.mdcc.core.repository.CustomerRegularReportRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CustomerReportServiceImpl implements CustomerReportService {

    @Autowired
    private CustomerRegularReportRepository customerRegularReportRepository;


    public void sendWeChatMsg_Customer() {
        QCustomerRegularReport qCustomerRegularReport = QCustomerRegularReport.customerRegularReport;
        BooleanBuilder builder = new BooleanBuilder();
        builder.and(qCustomerRegularReport.deleted.eq(false));
        builder.and(qCustomerRegularReport.enabled.eq(true));
        builder.and(qCustomerRegularReport.sended.eq(false));
        builder.and(qCustomerRegularReport.type.eq(false));
        builder.and(qCustomerRegularReport.customerReport.isNull());
        List<CustomerRegularReport> customerRegularReportList = (List<CustomerRegularReport>) customerRegularReportRepository.findAll(builder);
        for (CustomerRegularReport report : customerRegularReportList) {

        }
    }


}
